]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
main, LoginManager: Call GDM's RegisterSession()
authorIain Lane <iainl@gnome.org>
Thu, 2 May 2019 09:49:12 +0000 (10:49 +0100)
committerIain Lane <iainl@gnome.org>
Tue, 18 Jun 2019 08:21:58 +0000 (09:21 +0100)
So that it can know if we started up properly and use that to (e.g.)
kill its greeter.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/570

js/misc/loginManager.js
js/ui/main.js

index f615b4f999300bc0d179f8a0973f7fef6b9ae2af..4f4cc836fb68e2030d887c94ca6853d4ce232c3e 100644 (file)
@@ -48,6 +48,28 @@ function canLock() {
     }
 }
 
+
+function registerSessionWithGDM() {
+    log("Registering session with GDM");
+    Gio.DBus.system.call('org.gnome.DisplayManager',
+                         '/org/gnome/DisplayManager/Manager',
+                         'org.gnome.DisplayManager.Manager',
+                         'RegisterSession',
+                         GLib.Variant.new('(a{sv})', [{}]), null,
+                         Gio.DBusCallFlags.NONE, -1, null,
+        (source, result) => {
+            try {
+                source.call_finish(result);
+            } catch (e) {
+                if (!e.matches(Gio.DBusError, Gio.DBusError.UNKNOWN_METHOD))
+                    log(`Error registering session with GDM: ${e.message}`);
+                else
+                    log("Not calling RegisterSession(): method not exported, GDM too old?");
+            }
+        }
+    );
+}
+
 let _loginManager = null;
 
 /**
index 5f789e996dddd3b5eb2c1a139394c61db99ab940..70c550cc52fd9794a4306102dd8cdb9af9f72ea8 100644 (file)
@@ -250,6 +250,8 @@ function _initializeUI() {
             });
         }
 
+        LoginManager.registerSessionWithGDM();
+
         let perfModuleName = GLib.getenv("SHELL_PERF_MODULE");
         if (perfModuleName) {
             let perfOutput = GLib.getenv("SHELL_PERF_OUTPUT");